package com.fan89.controller;

import com.fan89.common.lang.Result;
import com.fan89.util.JsonUtil;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: yongbiao.fan
 * @Date: Create in 2020/8/22 9:37
 * @Url: https://www.fan89.com
 */
@Api(value = "测试api",tags = "测试接口")
@Controller
public class TestController {
    @GetMapping("/test2")
    public Result test(){
        int i=1/0;
        return Result.success("成功获取全部分类数据",i);
    }

    public static void main(String[] args) {
        Map<String,String> map=new HashMap();
        map.put("mobile","18265135883");

        byte[] bytes = JsonUtil.toJson(map).getBytes();
        System.out.println(bytes);
    }
}
